<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.js"></script>
<script type="text/javascript">
$(function(){
	$('#merNo').autocomplete({
	    	serviceUrl: '<%=request.getContextPath()%>/merchant_auto.html',
	    	minChars:1,
	    	paramName:'merNo',
	    	transformResult: function(response) {
    		　　return {
    		　　　　suggestions: $.map($.parseJSON(response), function(dataItem) {
    		　　　　　　return { value: dataItem.merNo, data: dataItem.merName};
    		　　　　})
    		　　};
    		},
	    	formatResult:function (suggestion, currentValue) {
	    		return "[" + suggestion.value.replace(currentValue,"<strong>"+currentValue+"</strong>")+ "]" + suggestion.data;
	    	}
	});

	$("#dataTable").datagrid({
		toolbar: '#dataSearch',
		fitColumns:true,
		striped: true, 
		singleSelect:false,
		pagination:true,
		rownumbers:true,
		SelectOnCheck:true,
		CheckOnSelect:true,
        onSelect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onSelectAll: function(rows){
        	var nos="";
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselectAll: function(rows){
			$("#keys").val("");
    	}
	});
	
	$('#dataTable').datagrid('getPager').pagination({
		total:<s:property value="pageInfo.pageRecord"/>,
		pageNumber:<s:property value="pageInfo.pageIndex"/>,
		pageSize:<s:property value="pageInfo.pageSize"/>,
		pageList: [20,50,100] ,
		onSelectPage:function(pageNumber,pageSize){  
			toPage(pageNumber,pageSize);
		},
		onRefresh:function(pageNumber,pageSize){  
			location.reload();
		}
	});
	
});

</script>
</head>
<body >
<div id="dataSearch" >    
<form id="sform" action="smb_listsettle.html" method="get" enctype="multipart/form-data">
<table style="width: 100%;">
<tr>
<td height="25" >
	<b>操作说明:多个商户号可以用逗号隔开</b> 
</td>
</tr>
<tr><td height="30" >
<s:textfield  id="merNo" name="steNo" placeholder="商户号"></s:textfield>

<input type="button" class="submit" value="查询搜索" onclick="sform.submit();"/></td>
</tr>
<tr><td><hr/></td></tr>
</table>
</form>
</div>

<table id="dataTable" style="width: 100%;" class="easyui-datagrid" >
<thead>
<tr>
<th data-options="field:'ck'" checkbox="true"></th>
<th data-options="field:'steNo', width:'10%',align:'left' , halign: 'left'">商户号</th>
<th data-options="field:'merName', width:'20%',align:'left' , halign: 'left'">商户名称</th>
<th data-options="field:'steSm', width:'10%',align:'left' , halign: 'left'">方向SM</th>
<th data-options="field:'steMs', width:'10%',align:'left' , halign: 'left'">方向MS</th>
<th data-options="field:'steBm', width:'10%',align:'left' , halign: 'left'">方向BM</th>
<th data-options="field:'steMb', width:'10%',align:'left' , halign: 'left'">方向MB</th>
<th data-options="field:'steTotal', width:'20%',align:'left' , halign: 'left'">资金总额</th>
<th data-options="field:'op', width:'100',align:'left' , halign: 'left'">操作</th>

</tr>
</thead>
<tbody>
<s:iterator value="settleList" id="show" status="seq">
<tr>
<td><s:property value="#show.steNo"/></td>
<td><s:property value="#show.steNo"/></td>
<td><label  id="merName_<s:property value="#show.steNo"/>"></label>
		<script type="text/javascript">
 		$("#merName_<s:property value="#show.steNo"/>").load("<%=request.getContextPath()%>/merchant_name.html?merNo=<s:property value="#show.steNo"/>");
 		</script>
</td>
<td><s:text name="global.format.number"><s:param value="#show.steSm"/></s:text></td>
<td><s:text name="global.format.number"><s:param value="#show.steMs"/></s:text></td>
<td><s:text name="global.format.number"><s:param value="#show.steBm"/></s:text></td>
<td><s:text name="global.format.number"><s:param value="#show.steMb"/></s:text></td>
<td><s:text name="global.format.number"><s:param value="#show.steTotal"/></s:text></td>
<td>
<input type="button" value="明细" style="width: 50px;" class="submit" onclick="location.href='<%=request.getContextPath()%>/smb_showsettle.html?steNo=<s:property value="#show.steNo"/>'"/>
</td>

</tr>
</s:iterator>
</tbody>
</table>
<br/>
<br/>
<br/>
</body>
</html>
